<?php include 'application/views/header.php' ?>
<h4 class="page-title">Thêm giải thưởng</h4>
<form accept="<?php echo base_url() ?>award/edit/<?php echo $Award['AwardId'] ?>" method="post" id="frmAwardEdit"
    enctype="multipart/form-data">
    <table width="100%" class="form award-edit">
       <tr>
            <th>Tên giải thưởng</th>
            <td><input type="text" value="<?php echo isset($Award['AwardName']) ? $Award['AwardName'] : '' ?>" name="AwardName" id="AwardName"/></td>
       </tr>
       <tr>
            <th>Hình ảnh</th>
            <td>
                <?php if(!empty($Award['AwardIcon'])): ?>
                    <img src="<?php echo $this->config->item('base_download') ?>/awards/<?php echo $Award['AwardIcon'] ?>" /><br />
                <?php endif; ?>
                <input type="file" name="AwardIcon" value="AwardIcon" />
            </td>
       </tr>
       <tr>
            <th>Liên kết trang giải thưởng</th>
            <td><input type="text" value="<?php echo isset($Award['AwardLink']) ? $Award['AwardLink'] : ''?>" name="AwardLink" id="AwardLink"/></td>
       </tr>
       <tr>
            <th>Ngày</th>
            <td>
                <input style="width: 150px;" type="text" value="<?php echo isset($Award['AwardDate']) ? $Award['AwardDate'] : ''?>" name="AwardDate" id="AwardDate"/>
            </td>
       </tr>
    
        <tr>
            <th>Sản phẩm</th>
            <td>
                <?php echo form_dropdown('ProductId', $OptionsProducts, isset($Award['ProductId']) ? $Award['ProductId'] : '') ?>
            </td>
       </tr>
        <tr>
            <th>Ẩn hiện giải thưởng</th>
            <td><input <?php echo (isset($Award['Visible']) && $Award['Visible'] == 1 ? 'checked="checked"' : '') ?>" type="checkbox" value="1" name="Visible" id="Visible"  /></td>
       </tr>
    </table>
    <div class="clr button-set">
        <input type="submit" value="Lưu giải thưởng" id="btnSave" />
        <input type="reset" value="Hủy nội dung vừa nhập" id="btnReset" />
        <input type="button" value="Về danh sách giải thưởng" id="btnBack" />
    </div>
</form>
<?php include 'application/views/footer.php' ?>
<script>
$('#btnBack').click(function(){
    window.location.href = '<?php echo base_url() ?>award.html'; 
});
$( "#AwardDate" ).datepicker({ dateFormat: 'yy-mm-dd' });
</script>